package com.tuo51.foudation.constant;

import lombok.Data;
import lombok.Setter;

/**
 * *******************************
 * Created by lch.
 * form com.matt
 * on 2018/12/03
 * *******************************
 */
@Data
public class SystemNotificationConstant {

    public enum Category{
       NON_MENU(0,"无菜单"),
        MENU(1,"有菜单");

        @Setter
        private int code;

        @Setter
        private String value;

        Category(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public SystemNotificationConstant.Category get(int code){
            for (SystemNotificationConstant.Category category : values()) {
                if (category.codeOf()==code)
                    return category;
            }
            return null;
        }
    }
}
